home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
Pascal
/
Snippets
/
PNL Libraries
/
Libraries
/
SpriteWorld
/
SpriteWorld files
/
Headers
/
SWCommonHeaders.h
< prev
next >
Wrap
Text File
|
1996-11-04
|
3KB
|
114 lines
///--------------------------------------------------------------------------------------
// SWCommonHeaders.h
//
// Portions are copyright: c 1991-94 Tony Myles, All rights reserved worldwide.
//
// Description: common macros, constants, and stuff, used throughout SpriteWorld
///--------------------------------------------------------------------------------------
#ifndef __RETRACE__
#include <Retrace.h>
#endif
#ifndef __SWCOMMON__
#define __SWCOMMON__
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
///--------------------------------------------------------------------------------------
// VBL-related stuff
///--------------------------------------------------------------------------------------
typedef struct VBLTaskRec VBLTaskRec;
typedef VBLTaskRec *VBLTaskRecPtr, **VBLTaskRecHdl;
struct VBLTaskRec
{
VBLTask myVBLTask;
volatile Boolean hasVBLFired;
};
///--------------------------------------------------------------------------------------
// sprite world definitions
///--------------------------------------------------------------------------------------
typedef struct SpriteWorldRec SpriteWorldRec;
typedef SpriteWorldRec *SpriteWorldPtr, **SpriteWorldHdl;
///--------------------------------------------------------------------------------------
// sprite world macros
///--------------------------------------------------------------------------------------
#if defined(powerc) || defined(__powerc)
#define SW_PPC 1
#else
#define SW_PPC 0
#endif
#if SW_PPC
#define XSW_USE_C 1
#else
#define XSW_USE_C SW_USE_C
#endif
#define SW_MIN(a, b) ((a) < (b) ? (a) : (b))
#define SW_MAX(a, b) ((a) > (b) ? (a) : (b))
// change this to '#define SW_FUNC pascal'
// to build a SpriteWorld library callable from pascal
#define SW_FUNC pascal
// SWAssert - PNL
#define SW_DEBUG 1
#if SW_DEBUG
#define SWAssert(x) SWAssertCode(x)
#else
#define SWAssert(x)
#endif
extern SW_FUNC void SWAssert( Boolean must );
#define kBitsPerByte 8
#if __MWERKS__
#define SW_ASM_FUNC asm
#define SW_ASM_BEGIN machine 68020
#define SW_ASM_END rts
#elif THINK_C
#define SW_ASM_FUNC
#define SW_ASM_BEGIN asm 68020{
#define SW_ASM_END }
#endif
///--------------------------------------------------------------------------------------
// compiled sprite definitions
///--------------------------------------------------------------------------------------
typedef short PixelCode, *PixelCodePtr, **PixelCodeHdl;
typedef void (*BlitFuncPtr)(
long srcStride,
long destStride,
Ptr srcBaseAddr,
Ptr destBaseAddr);
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#endif /*__SWCOMMON__*/